package com.peas.platform.module.icims.base.mdm.adapter.repository.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.peas.platform.common.core.annotation.Comment;
import com.peas.platform.framework.mybatisplus.po.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import javax.validation.constraints.*;

// 政府单位
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`tbl_government`")
public class GovernmentPo extends BasePo {

    // 政府单位类型
    // 0:施工单位、1:结算单位
    // 枚举取值:GovernmentType
    @Comment(value = "政府单位类型", enumType = "GovernmentType")
    @NotBlank(message = "政府单位类型不能为空")
    @Size(max = 20, message = "政府单位类型不能超过20个字符")
    @TableField(value = "`government_type`", jdbcType = JdbcType.VARCHAR)
    private String governmentType;

    // 政府单位编码
    @Comment(value = "政府单位编码")
    @Size(max = 50, message = "政府单位编码不能超过50个字符")
    @TableField(value = "`government_code`", jdbcType = JdbcType.VARCHAR)
    private String governmentCode;

    // 政府单位名称
    @Comment(value = "政府单位名称")
    @NotBlank(message = "政府单位名称不能为空")
    @Size(max = 200, message = "政府单位名称不能超过200个字符")
    @TableField(value = "`government_name`", jdbcType = JdbcType.VARCHAR)
    private String governmentName;

    // 状态
    // 枚举取值:CommonEnableDisable
    @Comment(value = "状态", enumType = "CommonEnableDisable")
    @NotBlank(message = "状态不能为空")
    @Size(max = 20, message = "状态不能超过20个字符")
    @TableField(value = "`state`", jdbcType = JdbcType.VARCHAR)
    private String state;

    // 备注
    @Comment(value = "备注")
    @TableField(value = "`remark`", jdbcType = JdbcType.CLOB)
    private String remark;

    // 上级政府单位ID
    // （政府单位表）外键
    @Comment(value = "上级政府单位ID")
    @TableField(value = "`parent_id`", jdbcType = JdbcType.BIGINT)
    private Long parentId;

}
